<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>添加用户</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="./layui/css/layui.css" th:href="@{/layui/css/layui.css}" media="all">
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="./js/html5.min.js" th:src="@{/js/html5.min.js}"></script>
    <script src="./js/respond.min.js" th:src="@{/js/respond.min.js}"></script>
    <![endif]-->
    <script type="text/javascript" charset="utf-8" th:inline="javascript">
        var ctxPath = /*[[@{/}]]*/'';
    </script>
</head>
<body>
<div class="layui-form" lay-filter="layuiadmin-form-useradmin" id="layuiadmin-form-useradmin"
     style="padding: 20px 20px 0 0;">
    <div class="layui-form-item">
        <label class="layui-form-label">账号</label>
        <div class="layui-input-inline">
            <input type="text" name="account" lay-verify="account" placeholder="请输入账号" autocomplete="off"
                   class="layui-input" lay-verType="tips">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">用户名</label>
        <div class="layui-input-inline">
            <input type="text" name="username" lay-verify="username" placeholder="请输入用户名" autocomplete="off"
                   class="layui-input" lay-verType="tips">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">标题</label>
        <div class="layui-input-inline">
            <input type="password" name="password" lay-verify="password" placeholder="请输入密码" autocomplete="off"
                   class="layui-input" lay-verType="tips">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">邮箱</label>
        <div class="layui-input-inline">
            <input type="text" name="email" lay-verify="email" placeholder="请输入邮箱" autocomplete="off"
                   class="layui-input" lay-verType="tips">
        </div>
    </div>
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">故障描述</label>
        <div class="layui-content">
<!--         layui-input-block   <textarea name="remarks" class="layui-textarea" placeholder="请输入备注" autocomplete="off"></textarea>-->
            <textarea id="content" lay-verify="content" name="content" style="display: none;"></textarea>
        </div>
    </div>
    <div class="layui-form-item layui-hide">
        <input type="button" lay-submit lay-filter="LAY-user-front-submit" id="LAY-user-front-submit" value="确认">
    </div>
</div>
<script src="./layui/layui.js" th:src="@{/layui/layui.js}"></script>
<script>
    // document.getElementsByClassName()[0].addEventListener("")
    layui.config({
        base: ctxPath //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['form','layedit'], function () {
        var form = layui.form;
        form.render(); //更新全部
        layui.use(['layedit', 'form'], function () {
            var form = layui.form;
            var layedit = layui.layedit;
            // 图片接口放到建立编辑器前面，否则无效
            layedit.set({
                uploadImage: {
                    url: ctxPath + 'monitor-feed/uploadconimage', //接口url
                    type: 'post', //默认post
                    // headers:{[[${_csrf.headerName}]]: [[${_csrf.token}]]},
                }

            });
            // 设置编辑器
            layedit.build('content', {
                height: 700 //设置编辑器高度
            });

            var index = layedit.build('content'); //建立编辑器
            form.verify({ // 这里就是把富文本数据同步到<textarea>中
                content: function (data) {
                    return layedit.sync(index);
                }
            });

        });
    });
</script>
</body>
</html>